package cn.itsource.pethome.basic.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 每个页面分页查询都需要当前页和每页显示条数
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseQuery {
    /**当前页面默认1*/
    private Integer currentPage = 1;
    /**当前页面条数默认10*/
    private Integer pageSize = 10 ;

    /**
     *  计算分页需要的开始条件
     */
    public Integer getBegin(){
        return  (this.currentPage - 1) * this.pageSize;
    }
}
